/**
 * Created by HP on 2017/10/17.
 */
// var mongoose = require('mongoose');
// var mongoosePaginate = require('mongoose-paginate');
//
// var schema = mongoose.Schema;
// var NewsSchema = new schema({
// 	name:String,
// 	password:String,
// 	date: { type: Date, default: Date.now }
// })
//
// NewsSchema.plugin(mongoosePaginate);
//
// module.exports = mongoose.model('News',NewsSchema,'news');

var mongoose = require('mongoose');
var mongoosePaginate = require('mongoose-paginate');
var moment = require('moment');
// console.log(moment().format());
var Schema = mongoose.Schema;
var ObjectId = Schema.ObjectId;

var schema = new mongoose.Schema({
	title:String,
	content:String,
	press:{ type:String,default:"阿里星星出版社" },
	date:{ type: Date, default: Date.now() },
	cateId:ObjectId,
	commentCount:Number,
	pic:{}
})

schema.plugin(mongoosePaginate);

var News = mongoose.model('News',schema,'news');
module.exports = News;